<?php

declare(strict_types=1);

/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

use App\Controller\client\DeviceController;
use App\Controller\client\NumberRecordController;
use App\Controller\client\SellerController;
use App\Controller\common\FileController;
use App\Controller\common\SettingController;
use App\Middleware\TokenMiddleware;
use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');
Router::addGroup('/client', function () {
    Router::addGroup('/seller', function () {
        Router::post('/login', [SellerController::class, 'login']);  /*验证账户登录*/
        Router::post('/getSellerBalance', [SellerController::class, 'getSellerBalance'], ['middleware' => [TokenMiddleware::class]]);  /*验证账户账户*/
    });
    Router::addGroup('/number_record', function () {
        Router::post('/add', [NumberRecordController::class, 'add'], ['middleware' => [TokenMiddleware::class]]);  /*增加设备恢复记录*/
    });
    Router::addGroup('/device', function () {
        Router::post('/checkStatusList', [DeviceController::class, 'checkStatusList']);  /*获取设备列表*/
    });
});
Router::addGroup('/common', function () {
    Router::addGroup('/setting', function () {
        Router::post('/getBucketZipSet', [SettingController::class, 'getBucketZipSet'], ['middleware' => [TokenMiddleware::class]]);  /*获取oss配置*/
    });
    Router::addGroup('/file', function () {
        Router::post('/addFilePath', [FileController::class, 'addFilePath'], ['middleware' => [TokenMiddleware::class]]);  /*新增zip资料包上传路径*/
    });
});

Router::get('/favicon.ico', function () {
    return '';
});
